package cn.chendd.api.service.impl;

import cn.chendd.api.client.OpenFeignClient;
import cn.chendd.api.po.UploadParam;
import cn.chendd.api.service.OpenFeignService;
import cn.chendd.api.vo.ComplexVo;
import feign.Response;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.awt.*;
import java.util.List;
import java.util.Map;

/**
 * Open Feign 接口实现
 *
 * @author chendd
 * @date 2023/1/8 20:37
 */
@Service
public class OpenFeignServiceImpl implements OpenFeignService {

    @Resource
    private OpenFeignClient openFeignClient;

    @Override
    public List<Point> getList() {
        return this.openFeignClient.getList();
    }

    @Override
    public ComplexVo getComplex() {
        return this.openFeignClient.getComplex();
    }

    @Override
    public String sayHello(String name) {
        return this.openFeignClient.sayHello(name);
    }

    @Override
    public String sayHello(String name, String value , String author) {
        return this.openFeignClient.sayHello(name , value , author);
    }

    @Override
    public String paramBody(String name, String body) {
        return this.openFeignClient.paramBody(name , body);
    }

    @Override
    public Response downloadYaml() {
        return this.openFeignClient.downloadYaml();
    }

    @Override
    public Response downloadImage() {
        return this.openFeignClient.downloadImage();
    }

    @Override
    public Map<String, Object> upload(List<MultipartFile> files, UploadParam param) {
        return this.openFeignClient.upload(files , param.getId() , param.getName() , param.getNikeNames());
    }
}
